package com.example.blog.service;

import com.example.blog.mapper.BlogInfoMapper;
import com.example.blog.model.BlogInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogService {
    @Autowired
    private BlogInfoMapper blogInfoMapper;

    public Integer insert(BlogInfo blogInfo){
        return blogInfoMapper.insertBlogInfo(blogInfo);
    }
    public Integer delete(Integer id){
        return blogInfoMapper.deleteBlogInfoById(id);
    }
    public Integer update(BlogInfo blogInfo){
        return blogInfoMapper.updateInfo(blogInfo);
    }
    public BlogInfo selectById(Integer id){
        return blogInfoMapper.selectBlogInfo(id);
    }
    public List<BlogInfo> selectAll(){
        return blogInfoMapper.selectBlogInfoAll();
    }
}
